package com.chukun.tx.constants;

/**
 * @author chukun
 * 消息状态
 */
public class MessageConstant {


    public static final String ORDER_MQ_TOPIC = "order";
    public static final String ORDER_MQ_GROUP = "order_group";

    /**
     * 双name server
     */
    public static final String DOUBLE_NAME_SERVER = "linux01:9876;linux02:9876";

    /**
     * 重试时间数组,单位秒
     */
    public static final int[] TIME_INTERVAL = new int[]{0, 5, 10, 25, 50, 100};

    /**
     * 消息状态
     */
    public enum MessageStatus {
        MESSAGE_CREATED((byte) 1, "消息已创建"),
        MESSAGE_HANDLING((byte) 2, "消息处理中"),
        MESSAGE_CONSUMED((byte) 3, "消息已消费"),
        MESSAGE_CONSUME_FAIL((byte) 4, "消息消费失败");

        private byte code;
        private String msgDesc;

        MessageStatus(byte code, String msgDesc) {
            this.code = code;
            this.msgDesc = msgDesc;
        }

        public byte getCode() {
            return code;
        }

        public String getMsgDesc() {
            return msgDesc;
        }
    }

}
